package com.example.demo.sever.impl;

import com.example.demo.mapper.UserMapper;
import com.example.demo.mybatis.entity.User;
import com.example.demo.sever.UserSever;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class userSeverImpl implements UserSever {
    @Autowired
    private UserMapper userMapper;
    @Override
    public boolean insert(User user) {
        boolean insert = userMapper.insert(user);
        return insert;
    }

    @Override
    public User SelectById(int id) {
        User user1;

         user1 = userMapper.SelectById(id);
        if (user1==null){
            user1=null;

        }

        return user1;
    }

    @Override
    public Boolean delectById(int number) {
        Boolean aBoolean = userMapper.delectById(number);
        return aBoolean;
    }

    @Override
    public boolean update(User user) {
        boolean update = userMapper.update(user);
        return update;
    }
}
